
<template>
    <rm-layout-top splitcolor="white" :splitwidth=5 :fixsize=35 :canDrag=false>
        <template v-slot:fix>
            <div style="height:35px;border:1px solid #CCC;padding:3px">
                <el-row>
                    <el-col :span="12">
                        <div class="grid-content bg-purple"> <span class="remind_class">您好，{{ loginusername }}，下方是您的所有待审核报告！</span></div>
                    </el-col>
                    <el-col :span="12">
                        <div style="line-height:25px">
                            <el-button style="width:72px" @click.native="btnRefresh">刷新</el-button>
                            <el-button style="width:72px" @click.native="btnClose">退出</el-button>
                        </div>
                    </el-col>
                </el-row>
            </div>
        </template>
        <div style="height:100%">
            <vxe-table show-overflow ref="xTable" :data.sync="reportdata" height="auto" width="100%" border size="mini" :select-config="{ reserve: true }" :sort-config="{ trigger: 'cell' }" show-header-overflow highlight-current-row resizable header-align="center" :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true, showIcon: false }" key="1" :row-class-name="rowclassname" class="mytable-style" :loading="loading">
                <vxe-table-column field="overtimeflag" title="超" width="30" align="center" sortable>
                    <template v-slot="{row}">{{row.overtimeflag=="1"?"超":""}}</template>
                </vxe-table-column>
                <vxe-table-column field="emer_flag" title="急" width="30" align="center" sortable>
                    <template v-slot="{ row }">
                        <div v-if="row.emer_flag == '1'">
                            <font color="red">急</font>
                        </div>
                        <div  v-else>
                        </div>
                    </template>
                </vxe-table-column>
                <vxe-table-column field="reportid" title="报告ID" width="120" sortable></vxe-table-column>
                <vxe-table-column field="rptunitname" title="报告单元" width="100" sortable></vxe-table-column>
                <vxe-table-column field="sampledate" title="标本日期" width="80" :formatter="['toDateString', 'yyyy-MM-dd']" sortable></vxe-table-column>
                <vxe-table-column field="sampleno" title="标本编号" width="80" align="center" sortable></vxe-table-column>
                <vxe-table-column field="prechkflag" title="标本状态" width="60" align="center">
                    <template v-slot="{row}">{{row.prechkflag=="1"?"待审核":""}}</template>
                </vxe-table-column>
                <vxe-table-column field="barcode" title="条码号" width="100" sortable></vxe-table-column>
                <vxe-table-column field="prereport_dt" title="预报告时间" width="140" sortable></vxe-table-column>
                <vxe-table-column field="pat_no" title="病人号" width="100" sortable></vxe-table-column>
                <vxe-table-column field="pat_name" title="病人姓名" width="120" sortable></vxe-table-column>
                <vxe-table-column field="pat_sex" title="性别" width="50" sortable>
                    <template v-slot="{row}">{{row.pat_sex=='1'?'男':row.pat_sex=='0'?'女':''}}</template>
                </vxe-table-column>
                <vxe-table-column field="pat_typecodename" title="病人类别" width="80" sortable></vxe-table-column>
                <vxe-table-column field="req_reason" title="送检目的" width="140" align="center" sortable></vxe-table-column>
                <vxe-table-column field="req_deptnoname" title="申请科室" width="80" align="center" sortable></vxe-table-column>
            </vxe-table>
        </div>
    </rm-layout-top>
</template>

<script type="text/javascript">
export default {
    name: "rm_reportalertinfo",
    props: {
        tabledata: { type: Array },
    },
    data() {
        return {
            loginusername: "",
            reportdata: this.tabledata,
            loading: false,
        };
    },
    created() {
        this.loginusername = this.$tool.getSession(this.$tool.loginusername);
    },
    computed: {},
    watch: {},
    mounted() {},
    methods: {
        btnRefresh() {
            this.loading = true;
            this.$tool
                .request({
                    url: "ucent/reportalert",
                    method: "post",
                    data: {
                        action: "showreportlist",
                    },
                })
                .then((res) => {
                    this.reportdata = res.data;
                    this.loading = false;
                })
                .catch((e) => {
                    this.$alert(e, "提示");
                    this.loading = false;
                });
        },
        //退出
        btnClose() {
            this.$emit("change", "close");
        },
        rowclassname({ row, column }) {
            if (row.overtimeflag == "1") {
                return "row-pink";
            }
        },
    },
};
</Script>

<style scoped>
.remind_class {
    color: rgb(236, 11, 11);
    font-size: 18px;
}
::v-deep .mytable-style .vxe-body--row.row-pink {
    background-color: pink;
    color: rgb(8, 8, 8);
}
</style>
